﻿using System;
using System.Web;
using System.Web.UI.WebControls;
using System.Data;
using BySoft.Server.Business;
using BySoft.Server.Common.Entity;
using BySoft.Server.Common.Enum;
using BySoft.Web.Utility;
using BySoft.Server.Consts;
using BySoft.Server.Common;
using BySoft.Web.Controls;

namespace BySoft.Web.Site.ComPage
{
    public partial class QueryCheck : BasePopPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Session["FailureSeason"] = null;
            }
            
        }

        protected void btnOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(ddlCheck.SelectedValue))
            {
                UIHelper.AlertMessage(this.Page, "请选择[审核选项]");
                return;
            }
            if (ddlCheck.SelectedValue.Equals("4")&&string.IsNullOrEmpty(txtFailureSeason.Text.Trim()))
            {
                UIHelper.AlertMessage(this.Page, "请输入作废原因");
                return;
            }
            string sReturn = "";
            sReturn = HttpUtility.UrlEncode(ddlCheck.SelectedValue, System.Text.Encoding.UTF8);
            Session["FailureSeason"] = txtFailureSeason.Text.Trim();
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>setCookie(dialogReturn_key,'" + sReturn + "',1);CloseTopDialog();</script>");
        }
    }
}